package com.medusa.aps.business.modules.board.model.output;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.TreeMap;

/**
 * <p>封装车间维度生产任务统计行数据</p>
 * @author An.Yan
 */
@Data
@Accessors(chain = true)
@Schema(description = "车间维度生产任务统计行数据")
public class WorkshopProductionRowData {

	/**
	 * 车间ID
	 */
	@Schema(description = "序号")
	private Integer workshopId;

	/**
	 * 车间code
	 */
	@Schema(description = "车间编码")
	private String workshopCode;

	/**
	 * 车间名称
	 */
	@Schema(description = "车间名称")
	private String workshopName;

	/**
	 * 与{@link WorkshopProductionRowData#workshopId}匹配的,按照统计日期升序排列的统计数据
	 */
	@Schema(description = "车间当日生产统计数据 映射 key:日期 value:任务详情")
	private TreeMap<String, WorkshopProductionItemData> dailyStatisticsMap = new TreeMap<>();

	/**
	 * 添加统计数据
	 * @param key 与{@link WorkshopProductionRowData#workshopId}匹配的日期
	 * @param value 与key匹配的统计数据对象
	 */
	public void put(String key, WorkshopProductionItemData value) {
		this.dailyStatisticsMap.put(key, value);
	}
}